package com.briup.bookstore.web.controller;

import com.briup.bookstore.response.Result;
import com.briup.bookstore.service.CategoryService;
import com.briup.bookstore.vo.CategoryInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author briup-adam
 * @Date 2023/8/8 上午10:25
 * @Description
 **/

@RestController
@Api(tags = "书籍分类模块")
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @ApiOperation("获取全部分类信息")
    @GetMapping("/list")
    public Result list() {
        List<CategoryInfoVO> list = categoryService.getAllCategory();
        return Result.success(list);

    }

}
